<html>
<head><meta charset="utf-8"><title>Timeout fetching crates.io index · t-compiler/rust-analyzer · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/index.html">t-compiler/rust-analyzer</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Timeout.20fetching.20crates.2Eio.20index.html">Timeout fetching crates.io index</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="244601982"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Timeout%20fetching%20crates.io%20index/near/244601982" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Timeout.20fetching.20crates.2Eio.20index.html#244601982">(Jul 01 2021 at 17:38)</a>:</h4>
<p>So I'm trying to use rust-analyzer from under a proxy and rust-analyzer consistently fails to run <code>cargo metadata</code> due to failing to fetch <a href="http://crates.io">crates.io</a> index.</p>



<a name="244602055"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Timeout%20fetching%20crates.io%20index/near/244602055" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Timeout.20fetching.20crates.2Eio.20index.html#244602055">(Jul 01 2021 at 17:39)</a>:</h4>
<p>Does <code>cargo metadata</code> work from a terminal? Are you setting any proxy-related env variables?</p>



<a name="244602075"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Timeout%20fetching%20crates.io%20index/near/244602075" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Timeout.20fetching.20crates.2Eio.20index.html#244602075">(Jul 01 2021 at 17:39)</a>:</h4>
<p>The failure happens due to a timeout - do you know by chance who is setting that timeout?</p>



<a name="244602120"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Timeout%20fetching%20crates.io%20index/near/244602120" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Timeout.20fetching.20crates.2Eio.20index.html#244602120">(Jul 01 2021 at 17:39)</a>:</h4>
<p>I don't think there's any timeout in RA itself</p>



<a name="244602128"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Timeout%20fetching%20crates.io%20index/near/244602128" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Timeout.20fetching.20crates.2Eio.20index.html#244602128">(Jul 01 2021 at 17:39)</a>:</h4>
<p>Because it happens pretty quickly, in a matter of seconds.</p>



<a name="244602667"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Timeout%20fetching%20crates.io%20index/near/244602667" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Timeout.20fetching.20crates.2Eio.20index.html#244602667">(Jul 01 2021 at 17:43)</a>:</h4>
<p>Let me check <code>cargo metadata</code> from command line, I certainly have all the proxy setup correct there.</p>



<a name="244603006"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Timeout%20fetching%20crates.io%20index/near/244603006" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Timeout.20fetching.20crates.2Eio.20index.html#244603006">(Jul 01 2021 at 17:46)</a>:</h4>
<p>Yep, it works on the command line.</p>



<a name="244603064"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Timeout%20fetching%20crates.io%20index/near/244603064" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Timeout.20fetching.20crates.2Eio.20index.html#244603064">(Jul 01 2021 at 17:46)</a>:</h4>
<p>What if you start Code (or your editor/IDE) from the terminal?</p>



<a name="244603309"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Timeout%20fetching%20crates.io%20index/near/244603309" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Timeout.20fetching.20crates.2Eio.20index.html#244603309">(Jul 01 2021 at 17:49)</a>:</h4>
<p>If you have proxy-related env variables, you can set them using <code>rust-analyzer.server.extraEnv</code> (it's a map)</p>



<a name="244603489"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Timeout%20fetching%20crates.io%20index/near/244603489" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Timeout.20fetching.20crates.2Eio.20index.html#244603489">(Jul 01 2021 at 17:50)</a>:</h4>
<p>The plugin doesn't consider the vscode's <code>"http.proxy"</code> setting?</p>



<a name="244603572"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Timeout%20fetching%20crates.io%20index/near/244603572" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Timeout.20fetching.20crates.2Eio.20index.html#244603572">(Jul 01 2021 at 17:51)</a>:</h4>
<p>I think that's only applies to extensions, while we spawn <code>cargo metadata</code> from the language  server.</p>



<a name="244603779"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Timeout%20fetching%20crates.io%20index/near/244603779" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Timeout.20fetching.20crates.2Eio.20index.html#244603779">(Jul 01 2021 at 17:52)</a>:</h4>
<p>Ah, in that case the <code>git fetch</code> can actually be missing the proxy variables, let me check.</p>



<a name="244605511"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Timeout%20fetching%20crates.io%20index/near/244605511" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Timeout.20fetching.20crates.2Eio.20index.html#244605511">(Jul 01 2021 at 18:06)</a>:</h4>
<p>Yep, <code>rust-analyzer.server.extraEnv</code> helps.<br>
Thanks!</p>



<a name="244606047"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Timeout%20fetching%20crates.io%20index/near/244606047" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Timeout.20fetching.20crates.2Eio.20index.html#244606047">(Jul 01 2021 at 18:11)</a>:</h4>
<p>It may still be a good idea for rust-analyzer to automatically run cargo (and other tools used by it, like git or maybe curl) in environment with proxy variables inherited from vscode's "http.proxy".</p>



<a name="244606312"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Timeout%20fetching%20crates.io%20index/near/244606312" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Timeout.20fetching.20crates.2Eio.20index.html#244606312">(Jul 01 2021 at 18:13)</a>:</h4>
<p>Yeah, that would be useful, but I'm not sure of the format. Can we just pass same value?</p>



<a name="244606473"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Timeout%20fetching%20crates.io%20index/near/244606473" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Timeout.20fetching.20crates.2Eio.20index.html#244606473">(Jul 01 2021 at 18:14)</a>:</h4>
<p>Ah, it's just an URL.</p>



<a name="244608341"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Timeout%20fetching%20crates.io%20index/near/244608341" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Timeout.20fetching.20crates.2Eio.20index.html#244608341">(Jul 01 2021 at 18:30)</a>:</h4>
<p>Yes, the same value.<br>
HTTP_PROXY = HTTPS_PROXY = http_proxy = https_proxy = vscode's "http.proxy"</p>



<a name="244609412"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Timeout%20fetching%20crates.io%20index/near/244609412" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Timeout.20fetching.20crates.2Eio.20index.html#244609412">(Jul 01 2021 at 18:40)</a>:</h4>
<p>Just filed <a href="https://github.com/rust-analyzer/rust-analyzer/issues/9448">https://github.com/rust-analyzer/rust-analyzer/issues/9448</a></p>



<a name="244641124"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Timeout%20fetching%20crates.io%20index/near/244641124" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Timeout.20fetching.20crates.2Eio.20index.html#244641124">(Jul 01 2021 at 23:43)</a>:</h4>
<p>FWIW, both uppercase and lowercase versions are important because some of the git/curl/wget/etc tools understand the uppercase version but not lowercase, and vice versa.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>